<?php
class BizfunAction extends BizbaseAction{
	function _initialize(){
	}

    function index(){


		die('index');
    }
    function test(){


		$userNewWebo =  D('Operate','weibo')->getHomeList( 1 , 1 ,0 ,2);
		print_r($userNewWebo);
	//				$otherData =  D('Operate','weibo')->getHomeList( $uid , $type='index' ,$since ,$row=10)

/*
//从个人ID获得公司ID
		$bizUserDao = D('BizCorpUser');
		$corpId = $bizUserDao->getCorpIdFromUserId(1);

//从公司Id获得公司信息
		$map = array("corpId","corpName","corpTitle");
		$BizCorpDao = D('BizCorp');
		$corpInfo = $BizCorpDao->getCorpInfoFromId($corpId,'zh-cn',$map);

//获得公司其他语种信息
		$BizCorpLangDao = D('BizCorpLang');
		$corpInfo = $BizCorpLangDao->getCorpInfoFromId($corpId,'zh-cn');




		die("<br />end");
*/
    }

    function favoriteIt(){
		/*检测是否登录*/
		if(!$this->checkLogin()){
			$this->outputJson();
		}

		/*检测所需信息是否齐全*/
		$map['favMod'] = empty($_POST['favMod']) ? '' : $_POST['favMod'];
		$map['favCatId'] = empty($_POST['favCatId']) ? 0 : $_POST['favCatId'];
		$map['favItemId'] = empty($_POST['favItemId']) ? 0 : $_POST['favItemId'];
		$map['favTitle'] = empty($_POST['favTitle']) ? '' : $_POST['favTitle'];
		$map['favUrl'] = empty($_POST['favUrl']) ? '' : $_POST['favUrl'];
		if(empty($map['favMod']) || empty($map['favItemId']) || empty($map['favTitle']) || empty($map['favUrl'])){
			$this->output['message'] = L('LANG_FAVORITEITNOOPTION').$favItemId;
			$this->output['result'] = 0;
			$this->outputJson();
		}
		$this->output['result'] = 1;

		/*检测是否有公司*/
		$bizUserDao = D('BizCorpUser');
		$corpId = $bizUserDao->getCorpIdFromUserId($this->uid);
		if(empty($corpId)){
			$corpId = 0;
		}
		$this->output['favoriteInfo']['corpId'] = $corpId;
		/*
		if(empty($corpId)){
			$this->output['message'] = L('LANG_YOUNOTCORP');
			$this->outputJson();
		}
		*/
		/*插入一条新的*/
		$favoriteDao = D('BizFavorite');
		$map['favUid'] = $this->uid;
		$map['corpId'] = $corpId;
		$ret = $favoriteDao->saveFavorite($map);  //添加记录
		$this->output = array_merge($this->output,$ret);
        $this->outputJson();
    }
}
?>